// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------
// Modification history:
// feature: Code style modification
// ------------------------------------------------------------------

#ifndef INCLUDE_ERTPS_SUBSCRIBER_SAMPLEINFO_H_
#define INCLUDE_ERTPS_SUBSCRIBER_SAMPLEINFO_H_

#include <edds/rtps/common/InstanceHandle.h>
#include <edds/rtps/common/SampleIdentity.h>
#include <edds/rtps/common/Time_t.h>

#include <ertps/ertps_dll.h>

#include <cstdint>

#include <edds/rtps/common/ChangeKind_t.hpp>

namespace evbs {
namespace ertps {

/**
 * Class SampleInfo_t with information that is provided along a sample when reading data from a
 * Subscriber.
 * @ingroup ERTPS_MODULE
 */
class RTPS_DllAPI SampleInfo_t {
 public:
    SampleInfo_t()
        : sampleKind(rtps::ALIVE),
          ownershipStrength(0U),
          sample_identity(rtps::SampleIdentity::unknown()),
          related_sample_identity(rtps::SampleIdentity::unknown()) {}

    virtual ~SampleInfo_t() {}

    //! Sample kind.
    rtps::ChangeKind_t sampleKind;
    //! Ownership Strength of the writer of the sample (0 if the ownership kind is set to
    //! SHARED_OWNERSHIP_QOS).
    uint32_t ownershipStrength;
    //! Source timestamp of the sample.
    rtps::Time_t sourceTimestamp;
    //! Reception timestamp of the sample.
    rtps::Time_t receptionTimestamp;
    //! InstanceHandle of the data
    rtps::InstanceHandle_t iHandle;

    rtps::SampleIdentity sample_identity;

    rtps::SampleIdentity related_sample_identity;
};

} /* namespace ertps */
} /* namespace evbs */

#endif  // INCLUDE_ERTPS_SUBSCRIBER_SAMPLEINFO_H_
